package testes;

import static org.junit.Assert.fail;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import codigoBase.MyDynamicStack;

public class MyDynamicStackTeste {

	private MyDynamicStack myDS;
	
	@Before
	public void setUp(){
		myDS = new MyDynamicStack(10);
		Assert.assertNotNull(myDS);
	}	
	
	
	
	@Test
	public void testMyDynamicStack() {
		
		
	}

	@Test
	public void testPush() {
		myDS = new MyDynamicStack(2);
		myDS.push(1);
		myDS.push(1);
		myDS.push(1);		
	}

	@Test
	public void testPop() throws Exception {

		myDS = new MyDynamicStack(2);
		myDS.push(1);
		myDS.pop();
		myDS.pop();
		
	}

	@Test
	public void testPeek() {
		myDS = new MyDynamicStack(2);
		myDS.push(1);
		Assert.assertEquals(1, myDS.peek());
	}

	@Test
	public void testIsStackEmpty() {
		myDS = new MyDynamicStack(0);
		Assert.assertEquals(true, myDS.isStackEmpty());
		
	}

	@Test
	public void testIsStackFull() {
		myDS = new MyDynamicStack(1);
		myDS.push(1);
		Assert.assertEquals(true, myDS.isStackFull());
	}

}
